var express = require("express");

const webpackDevMiddleware = require("webpack-dev-middleware")

const webpack = require("webpack")
var app = express()


// 加载配置文件
const config = require("./webpack.config.js")
// webpack 传入配置信息，，，，webpack根据配置信息进行编译
const  compiler = webpack(config)

// 生成express的中间件
var middleware = webpackDevMiddleware(compiler);

app.use(middleware)




app.listen(3000,()=>{
    console.log("服务已经开启，，在3000.。。。")
})
